cmake_minimum_required(VERSION 3.1)
PROJECT(SamplesAndTutos)

OPTION(INSTALL_SAMPLES "Once build, deploy samples into bin" ON)
OPTION(BUILD_CPP "Build c++ samples else c#" ON)

if(${BUILD_CPP})
    SET(TYPE "cpp")
else()
    SET(TYPE "csharp")
endif()

SET(SAMPLE_LIST "")
add_subdirectory("camera control/${TYPE}")
add_subdirectory("depth sensing/${TYPE}")
add_subdirectory("object detection/image viewer/${TYPE}")
add_subdirectory("object detection/birds eye viewer/${TYPE}")
add_subdirectory("body tracking/${TYPE}")
add_subdirectory("plane detection/${TYPE}")
add_subdirectory("positional tracking/${TYPE}")
add_subdirectory("spatial mapping/basic/${TYPE}")
add_subdirectory("svo recording/export/${TYPE}")
add_subdirectory("svo recording/playback/${TYPE}")
add_subdirectory("svo recording/recording/${TYPE}")
if(${BUILD_CPP})
	add_subdirectory("camera streaming/receiver/cpp")
	add_subdirectory("camera streaming/sender/cpp")
	add_subdirectory("spatial mapping/advanced point cloud mapping/cpp")
	add_subdirectory("other/cuda refocus")
	add_subdirectory("other/opengl gpu interop")
	add_subdirectory("other/multi camera/cpp")
endif()
add_subdirectory("tutorials")

if(${INSTALL_SAMPLES} AND ${BUILD_CPP})
    INSTALL(TARGETS ${SAMPLE_LIST} RUNTIME DESTINATION ${CMAKE_SOURCE_DIR}/bin)
endif()